#ifndef __PID_H__
#define __PID_H__

#include <stdint.h>

typedef struct{
	
	uint8_t adjustFlag1;
	uint8_t adjustFlag2;
	uint8_t adjustFlag3;
	uint8_t adjustFlag4;
	
	int8_t MotorGoalSpeed;
	
	float Target1;
	float Target2;
	float Target3;
	float Target4;
	float Actual1;
	float Actual2;
	float Actual3;
	float Actual4;
	
	float Out1;
	float Out2;
	float Out3;
	float Out4;
	
	float Kp;
	float Ki;
	float Kd;
	
	float Motor1_Error0;
	float Motor1_Error1;
	float Motor1_ErrorInt;
	
	float Motor2_Error0;
	float Motor2_Error1;
	float Motor2_ErrorInt;
	
	float Motor3_Error0;
	float Motor3_Error1;
	float Motor3_ErrorInt;
	
	float Motor4_Error0;
	float Motor4_Error1;
	float Motor4_ErrorInt;
	
	float OutMax;
	float OutMin;
}PID;

void PID_Caculate(PID* p);

#endif
